import React, { Component } from 'react';
import PropTypes from 'prop-types';

import NavItem from './navItem';

class Navbar extends Component {

    render() {
        const { navs } = this.props;

        return(
            <div className="navbar">
                {
                    navs.map((nav, index) => {
                        return <NavItem key={ index } text={ nav.text } link={ nav.link } />;
                    })
                }
            </div>
        );
    }
}

Navbar.displayName = "Navbar";

Navbar.propTypes = {
    navs: PropTypes.arrayOf(PropTypes.shape({
        text: PropTypes.string,
        link: PropTypes.string
    }))
};

export default Navbar;
